package tools;

import java.util.Random;

/**
 * Created by yangxianming on 2021/2/5.
 */
public class UUid {
    public static String getUUid(){
        return getUUid(16);
    }
    public static String getUUid(int size){
        String s = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
        Random random = new Random();
        String ss = "";
        while (ss.length() < size){
            int a = random.nextInt(62) + 1;
            ss = ss + s.substring(a-1, a);
        }
        return ss;
    }
}
